<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <div class="b">
  </div>
  <div class="c">
  </div>
  <div class="d">
  </div>
  <hr class="e" />
</body>
<style>
  body {
    position: absolute;
  }

  /* 对比的1px*/
  .b {
    width: 300px;
    border: 1px solid red;
  }

  /*基于缩放实现0.5*/
  .c {
    width: 300px;
    border: 1px solid red;
    transform: scaleY(.5);
  }

  /*基于渐变背景实现0.5*/
  .d {
    width: 302px;
    height: 2px;
    background-image: linear-gradient(0deg, red 50%, transparent 50%)
  }

  /* 基于hr实现0.5 */
  .e {
    border: 0px;
    border-bottom: 1px solid red;
    height: 1px;
  }
</style>

</html>